/** 切换中英文 */
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Space } from 'antd';
import { changeLanguage } from 'i18next';

interface IProps {

}

const ChangeLanguage: React.FC<IProps> = () => {
  const { i18n } = useTranslation();
  return (
    <Space size={8} >
      <Button
        type='link'
        onClick={() => {
          changeLanguage('zh')
        }}
      >{
          i18n.language === 'zh' ? '中文' : 'Chinese'
        }</Button>
      <Button
        type='link'
        onClick={() => {
          changeLanguage('en')
        }}
      >{
          i18n.language === 'en' ? 'English' : '英文'
        }</Button>
    </Space>
  )
}

export default ChangeLanguage;